<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List li = new ArrayList((Set)application.getAttribute("spiderList"));
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script type="text/javascript">    
   	function a(i)
   	{
	  <%
	  for(int iJsp = 0; iJsp < li.size(); iJsp++)
	  {
	  %>
		  if(i == <%=iJsp%>)
		  {
	   		var aId = "<%=li.get(iJsp) %>";
	   		var spiderthread = document.getElementById(aId).innerHTML;
	   		spiderthread = spiderthread.replace(/(^\s*|\s*$)/g,'');
	   		var url = spiderthread + "/spider.html";
	   		window.open(url);
	   		return;
	   	  }
   	  <%}%>
   	}
   	
   	function b(i)
   	{
	  <%
	  for(int iJsp = 0; iJsp < li.size(); iJsp++)
	  {
	  %>
		  if(i == <%=iJsp%>)
		  {
	   		var aId = "<%=li.get(iJsp) %>";
	   		var spiderthread = document.getElementById(aId).innerHTML;
	   		spiderthread = spiderthread.replace(/(^\s*|\s*$)/g,'');
	   		var url = "index.dll?&action=stop&id=" + spiderthread;
	   		window.open(url);
	   		return;
	   	  }
   	  <%}%>
   	}
  </script>
  </head>
  <body>
  <%
  for(int i = 0; i < li.size(); i++)
  {
  	System.out.println(li.get(i));
  %>
  <a id="<%=li.get(i) %>" name="<%=li.get(i) %>" onclick="a('<%=i %>')" target="_blank" style="color: #ff5C5C" href="">
  <%=li.get(i) %>
  </a>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <a id="b<%=li.get(i) %>" name="b<%=li.get(i) %>" onclick="b('<%=i %>')" href="">stop
  </a>
  <br>
  <%} %>
  
  <br>
  </body>
</html>
